"NewFileName" allows your Hypertalk scripts to request a NEW file name from the user. The functionall optionally accepts a prompt string and optionally accepts a default file name.
NewFileName() -- no prompt,no default
NewFileName("Enter a name:") --prompt, no default
NewFileName("Enter a name:","MyFile") --both
Examples:
on mouseUp
get NewFileName("New name for this file:", "My file")
-- name of a file the user picks goes into "it"
put "You chose to create…" & return into bkgnd field 1
if it is not empty then
put it after bkgnd field 1
else -- we return a null string if user hits Cancel
put "nothing!" after bkgnd field 1
end if
end mouseUp
on mouseUp
put NewFileName("New name for this file:", "My file") into theFile
if theFile is not empty then
open file theFile
repeat with i = 1 to 100
write i & ". " & ¬
"I will not throw food in class." & return to file theFile